package com.ruoyi.common.nmzp.server.entity.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

/**
 * 
 * @TableName nmzp_user_target
 */
@TableName(value ="nmzp_user_target")
public class NmzpUserTarget implements Serializable {
    /**
     * id
     */
    @TableId
    private Long id;

    /**
     * 用户Id
     */
    private Long userId;

    /**
     * 目标id
     */
    private Long targetId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    public Long getId() {
        return id;
    }

    /**
     * id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 用户Id
     */
    public Long getUserId() {
        return userId;
    }

    /**
     * 用户Id
     */
    public void setUserId(Long userId) {
        this.userId = userId;
    }

    /**
     * 目标id
     */
    public Long getTargetId() {
        return targetId;
    }

    /**
     * 目标id
     */
    public void setTargetId(Long targetId) {
        this.targetId = targetId;
    }

    public NmzpUserTarget() {
    }

    public NmzpUserTarget(Long userId, Long targetId) {
        this.targetId = targetId;
        this.userId = userId;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        NmzpUserTarget other = (NmzpUserTarget) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getTargetId() == null ? other.getTargetId() == null : this.getTargetId().equals(other.getTargetId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getTargetId() == null) ? 0 : getTargetId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", targetId=").append(targetId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}